
local totalAmmo = achievements.GetValue( "Scavenger", "total", 0 )
local function HUDAmmoPickedUp( class, amount )
	if ( totalAmmo == 5000 ) then return end
	totalAmmo = math.min( totalAmmo + amount, 5000 )
	achievements.Update( "Scavenger", totalAmmo / 5000, totalAmmo .. "/5000" )
	achievements.SetValue( "Scavenger", "total", totalAmmo )
end
hook.Add( "HUDAmmoPickedUp", "Achievements.Scavenger", HUDAmmoPickedUp )

achievements.Register( "Scavenger", "Pick up 5000 units of ammunition.", "achievements/scavenger", totalAmmo / 5000, totalAmmo .. "/5000" )